/*
 * This file is part of Annuaire.
 *
 * Annuaire is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Annuaire is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Annuaire.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.miage.annuaire.data;

import org.miage.annuaire.data.mock.DataAccessMock;

/**
 * Cette classe permet d'accéder à l'implémentation de l'interface DataAccess.
 * @author guhumber
 */
public class DataAccessFactory {

	/**
	 * Singleton.
	 */
	private DataAccessFactory() {
		// Rien.
	}

	/**
	 * Renvoie l'unique instance de cette classe.
	 * @return L'unique instance de cette classe.
	 */
	public static DataAccessFactory getInstance() {
		return instance;
	}
	
	public DataAccess getDataAccess() {
		return new DataAccessMock();
	}

	public ObjectDataAccess getObjectDataAccess() {
		return new ObjectDataAccessImpl();
	}

	public XmlDataAccess getXmlDataAccess() {
		return new XmlDataAccessImpl();
	}

	/**
	 * L'unique instance de cette classe.
	 */
	private static DataAccessFactory instance = new DataAccessFactory();
}
